<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/11 0011
 * Time: 下午 2:29
 */
return [
    'enablePrettyUrl' => true,
    'enableStrictParsing' => true,
    'showScriptName' => false,
    'suffix' => '',//这个因为在common/main.php里设置成了.html格式结尾，所以在这边会报404错误，这里把设置覆盖掉
    'rules' => [
        '' => 'site/index',
        '/index1' => 'site/index1',
        //未设置登陆校验的控制器，site，因为没有登陆校验，所以一般用来做实验
        [
            'class' => yii\rest\UrlRule::className(),
            'controller' => ['site'],
            'pluralize' => false,
            'extraPatterns' => [
                'GET index1' => 'index1'
            ],
            'only' => ['index1']
        ],
        //订单
        [
            'class' => yii\rest\UrlRule::className(),
            'controller' => ['order'],
            'pluralize' => false,
            'extraPatterns' => [
                'GET add' => 'add',//添加订单
                'GET seckill' => 'seckill'//订单秒杀
            ],
            'only' => ['add', 'seckill'],
        ],
        //商品
        [
            'class' => yii\rest\UrlRule::className(),
            'controller' => ['good'],
            'pluralize' => false,
        ],
    ],
];